package priv.lirenhe.dissertation.component.crawler_robot.crawler_actions.crawler_actions_executor;

import priv.lirenhe.dissertation.component.crawler_robot.crawler_actions.crawler_charset.CrawlerCharset;
import priv.lirenhe.dissertation.component.crawler_robot.crawler_actions.crawler_client.HttpClientCrawler;

public class CrawlerActionsExecutor {
	
	public String execute(String url){
		
		System.out.println("CrawlerActionsExecutor execute---");
		
		String webContent =null;
		HttpClientCrawler httpClientCrawler = new HttpClientCrawler();
		webContent = httpClientCrawler.doGet(url,null);
		
		if(webContent != null && webContent.length()>50){
			webContent = CrawlerCharset.changeCharset(webContent);
		}
		
		//如果这里返回的内容有问题，再解决
		return webContent;
	}
	
	public static void main(String[] args) {
		CrawlerActionsExecutor cra = new CrawlerActionsExecutor();
		System.out.println(cra.execute("http://www.apple.com/cn/"));
	}
}
